package businessServlets;

import java.io.IOException;
import javax.servlet.http.*;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

import controller.Controller;
import dataBase.Business;

@SuppressWarnings("serial")
public class CheckItServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		System.out.println("checkit");
	 	
		Business b = Controller.getInstance().getBiz("bizType");
//	 	System.out.println("key name : "+ ad.getKey().getName());
//	 	System.out.println("key id : "+ad.getKey().getId());
	 	long id = b.getKey().getId();
	 	Key key = KeyFactory.createKey("Bussiness", id);
	 	//Key key = KeyFactory.createKey(MyEntity.class.getSimpleName(), id);
	 	
	 	Business b1 = Controller.getInstance().keyToBusiness(id);
	 	System.out.println(b1);
	 	System.out.println("b1 username " +b1.getUserName());
	 	System.out.println("b1 username " +b1.getUserName());
	 	
		resp.sendRedirect("/tryImage.jsp"); //addOrder.jsp
	}
}
